<template>
  <h1>从store中解构</h1>
  <h2>count:{{ count }}</h2>
  <h2>doublecount:{{ doubleCount }}</h2>
  <button @click="increment">+</button>
  <hr>
  <h1>从store中直接取值</h1>
  <h2>count:{{ SetupStore.count }}</h2>
  <h2>doublecount:{{ SetupStore.doubleCount }}</h2>
  <button @click="SetupStore.increment">+</button>
</template>

<script setup>
import {storeToRefs} from "pinia"
import {useSetupStore} from "@/stores/SetupStore";

const SetupStore = useSetupStore();
console.log(SetupStore)
// const{count,doubleCount,increment}=SetupStore
const {count, doubleCount} = storeToRefs(SetupStore)
const {increment} = SetupStore
</script>

<style scoped>

</style>